﻿namespace Sayook.Framework.DbCore.SqlModel
{
    /// <summary>
    /// Sql关键字
    /// </summary>
    public class SqlKeyWord
    {
        /// <summary>
        /// 查询语句模板
        /// 0：查询字段
        /// 1：表名
        /// </summary>
        public const string Select = "SELECT {0} FROM {1} ";

        /// <summary>
        /// 去重查询语句模板
        /// 0：查询字段
        /// 1：表名
        /// </summary>
        public const string SelectDistinct = "SELECT DISTINCT {0} FROM {1} ";

        /// <summary>
        /// 插入语句模板
        /// 0：表名
        /// 1：插入字段
        /// 2：@插入字段
        /// </summary>
        public const string Insert = "INSERT INTO {0} ({1}) VALUES ({2})";

        /// <summary>
        /// 更新语句模板
        /// 0：表名
        /// 1：更新字段
        /// </summary>
        public const string Update = "UPDATE {0} SET {1}";

        /// <summary>
        /// DELETE 语句 模板
        /// </summary>
        public const string Delete = "DELETE FROM {0}";

        public const string Where = " WHERE ";
        public const string And = " AND ";
        public const string Or = " OR ";
        public const string Groupby = " GROUP BY ";

        /// <summary>
        /// 查询所有字段
        /// </summary>
        public const string FiledAll = " * ";

        public const string Ordeyby = " ORDER BY ";
        public const string OrdeybyAsc = " ASC ";
        public const string OrdeybyDesc = " DESC ";

        public const string MysqlPaging = " LIMIT {0},{1} ";
        public const string SqlServerPaging = "  OFFSET {0} ROWS FETCH NEXT {1} ROWS ONLY ";
    }
}